package com.ty.controller;

import com.ty.bean.AgentInquiry;
import com.ty.common.bean.ResultBean;
import com.ty.common.controller.BaseController;
import com.ty.mapper.error_LoaninquiryaddMapper;
import com.ty.query.LoaninquiryQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api")
@Api(tags = "货代询价添加")
public class error_LoaninquiryaddController extends BaseController {

    @Autowired
    error_LoaninquiryaddMapper loaninquiryaddMapper;

    @ApiOperation("保存客户")
    @PostMapping("/loaninquiryadd")
    public ResultBean save(@RequestBody AgentInquiry loaninquiryadd) {
        int rs = loaninquiryaddMapper.save(loaninquiryadd);
        return saveResult(rs);
    }

    @ApiModelProperty("查看货代信息")
    @PostMapping("/loaninquiryadd/list")
    public ResultBean queryBy (@RequestBody LoaninquiryQuery query){
        List<Map> bean = loaninquiryaddMapper.queryByMap();
        return success("货代信息",bean);
    }


}
